package lagou.ExceptionTest;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class ExceptionCatchTest {
    public static void main(String[] args) {
        FileInputStream file = null;
        try {
            file = new FileInputStream("D:/a.txt");
        } catch (FileNotFoundException e) {
            System.out.println("异常了哥");
            e.printStackTrace();
//            throw new RuntimeException(e);
        }
        try {
            file.close();
        } catch (IOException e) {
            System.out.println("异常了兄弟");
            e.printStackTrace();
//            throw new RuntimeException(e);
        } catch (NullPointerException e) {
            e.printStackTrace();
        }
        System.out.println("嗨嗨嗨");
    }
}
